package com.lbd.gulimall.order.vo;

import lombok.Getter;
import lombok.Setter;

import java.math.BigDecimal;
import java.util.List;

/**
 * @Author: linbd
 * @Description:
 * @Date: 2023/3/26 17:19
 */
public class OrderItemVO {
    @Getter
    @Setter
    private Long skuId;
    @Getter
    @Setter
    private String title;
    @Getter
    @Setter
    private String image;
    @Getter
    @Setter
    private BigDecimal price;
    @Getter
    @Setter
    private Integer count;
    @Getter
    @Setter
    private List<String> skuSaleList;
    @Getter
    @Setter
    private Boolean hasStock;
    private BigDecimal totalPrice;

    public BigDecimal getTotalPrice() {
        totalPrice = price.multiply(BigDecimal.valueOf(count));
        return totalPrice;
    }

    @Override
    public String toString() {
        return "OrderItemVO{" +
                "skuId=" + skuId +
                ", title='" + title + '\'' +
                ", image='" + image + '\'' +
                ", price=" + price +
                ", count=" + count +
                ", skuSaleList=" + skuSaleList +
                ", totalPrice=" + getTotalPrice() +
                '}';
    }
}
